{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {include file="public/tophead" /}
        {include file="public/top" /}
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="example">
                        <table data-toggle="table">
                            <thead>
                                <tr>
                                    <th data-align="center">ID</th>
                                    <th data-align="center">类型</th>
                                    <th data-align="center">模板ID</th>
                                    <th data-align="center">创建时间</th>
                                    <th data-align="center">修改时间</th>
                                    <th data-align="center">管理</th>
                                </tr>
                            </thead>
                            <tbody>
                            {volist name="data" id="v"}
                                <tr id="id{$v.id}">
                                    <td>{$v.id}</td>
                                    <td>{$type[$v.type]['name']}</td>
                                    <td>{$v.template_id}</td>
                                    <td>{$v.create_time|date="Y-m-d H:i:s"}</td>
                                    <td>{$v.update_time|date="Y-m-d H:i:s"}</td>
                                    <td>
                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">
                                                操作 <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu">
                                                <li><a onclick="add('{:url('sms/templateAdd', ['id' => $v['id'], 'type' => $v['type'], 'url' => '-1'])}')">修改</a></li>
                                                <li class="divider"></li>
                                                <li><a onclick="del({$v.id})">删除</a>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$data->render()|raw}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.css"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.js"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table-zh-CN.min.js"}
<script type="text/javascript">
function add(url){
    layer.open({
        type: 2,
        title: '短信模板管理',
        shadeClose: false,
        shade: 0.2,
        area: ['80%', '80%'],
        skin:'shangchuantup',
        // shift:-1,
        content: url,
    });
}
function del(id){
    swal_del(id,"{:url('templateDel')}", {title: '此短信模板'})
}
</script>